package com.jdd.enterprise.api.dto;

import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
 * @author xxxx
 */
@Getter
@Setter
public class ApiRequest<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    private String trace;
    @Valid
    @NotNull(message = "请求参数不能为空！")
    private T param;
    public ApiRequest() {
        super();
    }
    public ApiRequest(T param) {
        this.param = param;
    }
    public static <T> ApiRequest<T> create(T param) {
        return new ApiRequest<T>(param);
    }
}
